package org.jeecg.modules.payment.enums;

import org.jeecg.common.annotation.EnumDict;
import org.jeecg.common.enums.IEnumDict;
import org.jeecg.common.exception.JeecgBootException;

@EnumDict(code ="biz_type_enums", name = "业务类型")
public enum BizTypeEnums implements IEnumDict<BizTypeEnums> {

    RENTAL_EBIKE("rental_ebike", "租赁电单车", "ebike", "rental.ebike.pay.success"),

    BUY_COUPON("buy_coupon", "购买卡券", "coupon", "buy.coupon.pay.success"),
    RENTAL_SOCKET("rental_socket", "充电桩充电", "socket", "rental.socket.pay.success"),

    RENTAL_BMS("rental_bms", "租赁电池", "bms","");




    private String value;

    private String label;
    /**
     * 不一定要有，为了前端vue渲染有个key
     */
    private String key;

    /**
     * 队列名称
     */
    private String queueName;

    BizTypeEnums(String value, String label, String key, String queueName) {
        this.value = value;
        this.label = label;
        this.key = key;
        this.queueName = queueName;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getRemark() {
        return null;
    }

    public String getQueueName() {
        return queueName;
    }

    public static BizTypeEnums getEnumByValue(String value){
        for(BizTypeEnums item: values()){
            if(value.equals(item.value)){
                return item;
            }
        }
        throw new JeecgBootException("没找到对应字典");
    }

}
